<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="cache-control" content="no-cache">
    <meta content="0" http-equiv="expires">
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <title>欢迎进入聊天室</title>
    <style>
        body, html {
            margin: 0;
            padding: 0;
            height: 100%;
            font-family: Arial, sans-serif;
        }

        .welcome {
            background-image: linear-gradient(-180deg, #1a1454 0%, #0e81a5 100%);
            background-repeat: no-repeat;
            background-size: cover;
            height: 100vh;
            display: flex;
            justify-content: center;
            align-items: center;
        }

        .home {
            width: 650px;
            padding: 20px;
            border-radius: 10px;
            background-color: rgba(0, 0, 0, 0.5);
            box-shadow: 10px 10px 20px 0px rgba(0, 0, 0, 0.7);
            text-align: center;
            color: #FFFFFF;
            animation: fadeIn 1s ease forwards;
        }

        .title {
            font-size: 3rem;
            color: rgb(194, 221, 252);
            margin: 0 0 20px;
            animation: slideDown 1s ease forwards;
        }

        .subtitle {
            font-size: 1.5rem;
            color: rgba(238, 236, 236, 0.7);
            margin: 1rem 0 2rem;
            animation: slideUp 1s ease forwards;
        }

        a {
            text-decoration: none; /* 去掉链接下划线 */
        }

        @keyframes slideDown {
            from {
                opacity: 0;
                transform: translateY(-50px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        @keyframes slideUp {
            from {
                opacity: 0;
                transform: translateY(50px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        @keyframes fadeIn {
            from {
                opacity: 0;
            }
            to {
                opacity: 1;
            }
        }
    </style>
</head>
<body>
<div id="loading"
     style="font-size: 30px; display: flex; align-items: center; justify-content: center; height: 100vh; background-color: #fff;">
    <!-- 加载动画 -->
    <div>加载中...</div>
</div>
<div id="app" class="welcome" style="display: none;">
    <div class="home">
        <h1 class="title">欢迎来到聊天室</h1>
        <p class="subtitle">仅需昵称登录，就可畅享群聊、私聊等功能</p>
        <el-button type="primary" tag="a" href="websocket/hello.html" target="_blank"
                   rel="noopener noreferrer"
                   round>
            开始使用
        </el-button>
    </div>
</div>


<script src="https://cdn.staticfile.net/vue/3.3.4/vue.global.prod.js"></script>
<link rel="stylesheet" href="https://unpkg.com/element-plus/dist/index.css">
<script src="https://unpkg.com/element-plus@2.7.3/dist/index.full.js"></script>
<script type="module">
    const {onMounted} = Vue;

    const App = {
        setup() {
            // 初始化完成后隐藏加载动画，并显示应用
            onMounted(() => {
                document.getElementById('loading').style.display = 'none';
                document.getElementById('app').style.display = 'flex'; // 显示主内容
            });
        }
    };
    const app = Vue.createApp(App);
    app.use(ElementPlus);
    app.mount("#app");

</script>
</body>
</html>
